package com.lechuang.user.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * @author apple
 */
@Getter
@AllArgsConstructor
public enum UserAuthStatusEnum {
    UN_SUBMIT(1, "未认证提交"),
    AUTH_ING(2, "认证中"),
    AUTH_SUCCESS(3, "认证成功"),
    NOT_PASS(4, "未通过");

    private Integer id;
    private String value;

    private static final Map<Integer, UserAuthStatusEnum> VALUE_MAP = new HashMap<>();

    static {
        for (UserAuthStatusEnum e : UserAuthStatusEnum.values()) {
            VALUE_MAP.put(e.id, e);
        }
    }

    public static UserAuthStatusEnum getByValue(Integer id) {

        return VALUE_MAP.get(id);
    }

}
